import * as salaryIncrease from '@/api/salary-increase'

const state = {
  salaryIncreaseList: []
}
const mutations = {
  SET_SALARYINCREASE_LIST: (state, newValue) => {
    state.salaryIncreaseList = newValue
  }
}
const actions = {
  async updateSalaryIncreaseList({ commit }, userId) {
    // 发请求
    // 拿到数据
    const res = await salaryIncrease.getSalaryIncreaseList(userId)
    // 把数据传给mutation
    // mutation改数据
    commit('SET_SALARYINCREASE_LIST', res)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
